// interface ObjectA {
//   a: string
// }
// interface ObjectB {
//   b: string
// }

// let Aa: ObjectA = {
//   a: 'a'
// }
// let Bb: ObjectB = {
//   b: 'b'
// }

// let AB: ObjectA & ObjectB = Object.assign(Aa, Bb)
// console.log(AB);

class ClassA {
  public isA: Boolean | undefined
  funcA() {}
}

class ClassB {
  public isB : boolean | undefined
  funcB() {}
}

class  ClassAB implements ClassA, ClassB {
  public isA = false;
  public isB = false;
  public funcA = (): void => {}
  public funcB = (): void => {}
  constructor() {}
}

function mixins(base: any, from: any[]) {
  from.forEach(fromItem => {
    Object.getOwnPropertyNames(fromItem.prototype).forEach((key: any) => {
      console.log(key);
      base.prototype[key] = fromItem.prototype[key]
    })
  })
}

mixins(ClassAB, [ClassA, ClassB])
const ab = new ClassAB()
console.log(ab);
